<% layout("/WEB-INF/view/console/skins/skin_2/layout.html", {}) {
%>
<div class="row">
    <div class="col-md-12">
        <div class="widget-container fluid-height clearfix">
            <div class="widget-content padded clearfix">
                <div class='row'>
                    <div class='col-md-12'>
                        <form name="boTasteGoods_form" id="boTasteGoods_form" class='form-inline'>

 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='状态' >是否发布：</label>
 <select class="form-control" id="boStatus" name="boStatus">
 <option  value="">请选择...</option>
 	<option  value="1">是</option>
 	<option  value="0">否</option>
 </select>
 </div>
 
                        </form>
                    </div>
                </div>
                <div class='row'>
                    <div align="center">
                        <button type='button' class='btn btn-default' id='boTasteGoodsQuerySearch'>查询</button>
                        <button type='button' class='btn btn-default' id='boTasteGoodsReset'>重置</button>
                    </div>
                </div>
                 <div id="boTasteGoodsToolbar" class="btn-group">
                              <button type="button" class="btn btn-default" onclick="consoleOpenWindow('boTasteGoods','${ctxPath}/console/bo_taste_goods/add','新增')">
                                  <i class="glyphicon glyphicon-plus"></i>
                              </button>
                              <button type="button" class="btn btn-default" onclick='boTasteGoodsConsoleGrid.delete("boTasteGoodsId","${ctxPath}/console/bo_taste_goods/delete");'>
                                  <i class="glyphicon glyphicon-trash"></i>
                              </button>
                 </div>
                     <div class='row'>
                              <div class='col-md-12'>
                                  <table id="boTasteGoods" data-toggle="table"
                                         data-url="${ctxPath}/console/bo_taste_goods/json"
                                         data-pagination="true"
                                         data-query-params="boTasteGoodsLoadParam"
                                         method="post"
                                         data-side-pagination="server"
                                         data-show-refresh="true"
                                         data-show-toggle="true"
                                         data-pagination-loop="false"
                                         data-show-columns="true"
                                         data-toolbar="#boTasteGoodsToolbar">
                                      <thead>
                                      <tr>
                                           <th data-checkbox="true"></th>
                                            <th data-field='boTasteGoodsId' data-visible='false'>ID</th>
  <th data-sortable='true' data-field='goodsName'>商品</th>
                                          <th data-sortable='true' data-field='tastePrice'>试吃金额</th>
  <th data-sortable='true' data-field='boTotalNum'>总数量</th>
  <th data-sortable='true' data-field='boRemainNum'>剩余数量</th>
  <th data-sortable='true' data-field='boStartDate' data-formatter="consoleTableDateFormat">开始时间</th>
  <th data-sortable='true' data-field='boEndDate' data-formatter="consoleTableDateFormat">截止时间</th>
  <th data-field='boStatus' data-sortable='true' data-formatter='boTasteGoodsbo_statusFormatter'>状态</th>
  <th data-field='boTasteGoodsId' data-formatter='boTasteGoodsTableOperate'>操作</th>
 
                                      </tr>
                                      </thead>
                                  </table>
                              </div>
                     </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
     var boTasteGoodsConsoleGrid =new consoleGrid({table_id:"boTasteGoods"});
     boTasteGoodsConsoleGrid.init();
     function boTasteGoodsTableOperate(value){
         return "<button type='button' class='btn btn-xs btn-default command-edit' onclick='consoleOpenWindow(\"boTasteGoods\",\"${ctxPath}/console/bo_taste_goods/edit?id="+value+"\",\"编辑\")'><span class='glyphicon glyphicon-pencil'></span></button> ";
     }
    function boTasteGoodsLoadParam(params){
        params.query=boTasteGoodsQueryString();
        return params;
    }
     function boTasteGoodsQueryString() {
         var objQuery = new Object();

     objQuery.boStatus=$('#boStatus').val()==''?null:$('#boStatus').val(); 
 
         var queryString = JSON.stringify(objQuery);
         return queryString;
     }

     function boTasteGoodsbo_statusFormatter(value) 
   { 
       var showValue=''; 
       switch(value+''){
       case '1': 
       showValue = '是';
       break;
       case '0': 
       showValue = '否';
       break;
       }
    if(showValue.indexOf('不')!=-1||showValue.indexOf('否')!=-1||showValue.indexOf('禁')!=-1){    
       return '<span class="label label-warning">'+showValue+'</span>';
   }else{
       return '<span class="label label-info">'+showValue+'</span>';
   }
   }

 </script>
<%} %>
 